package util;

/**
 * @author wevil
 * @date 2020/2/1
 * @update 2020/12/17
 */
public class JSONResponseUtil<T> {

    /**
     * 消息
     * */
    String message;

    /**
     * 返回内容
     */
    T data;


    public JSONResponseUtil(String message, T data) {
        this.message = message;
        this.data = data;
    }

    public static <T> JSONResponseUtil<T> success(T data) {
        return new JSONResponseUtil<>( "SUCCESS", data);
    }

    public static <T> JSONResponseUtil<T> fail(T data) {
        return new JSONResponseUtil<>( "FAILED", data);
    }

}
